<?php

namespace app\admin\validate\setting;

use tmcore\base\BaseValidate;

/**
 * mysql数据库验证器
 */
class DbMysqlValidate extends BaseValidate
{

    protected $rule = [
        'table_name' => 'require',
        'tables' => 'require',
    ];

    protected $message = [
        'table_name' => '表名不能为空',
        'tables' => '表不能为空',
    ];

    /**
     * 获取表详情场景
     * @return DbMysqlValidate
     */
    public function sceneDetail()
    {
        return $this->only(['table_name']);
    }

    /**
     * 优化表场景
     * @return DbMysqlValidate
     */
    public function sceneOptimize()
    {
        return $this->only(['tables']);
    }

    /**
     * 清理表场景
     * @return DbMysqlValidate
     */
    public function sceneFragment()
    {
        return $this->only(['tables']);
    }

}